package game;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
/*
 * Team: Sting Arrays
 * Creators: Devin La Fleur. and Jonathan Satchell.
 * Game: Defend Chernobly
 */
public class Gun extends JLabel{

	public static enum Type{
		Berretta, M16, P90, Pump_Action, Rifle
	}
	public boolean EQUIPED;
	public Type type;
	public int damage;
	public int clip;
	public int reloadTime;
	public ImageIcon img;
	public int cost;
	String toString;

	public Gun(Type type)
	{
		//sets up the gun based on type
		EQUIPED = false;
		this.type = type;
		switch(this.type)
		{
			case Berretta:
				damage = 5;
				clip = 5;
				img = new ImageIcon("Images/Berretta.png");
				reloadTime = 40;
				cost = 0;
				toString = "Berretta";
				break;
			case Pump_Action:
				damage = 8;
				clip = 6;
				img = new ImageIcon("Images/Pump Action.png");
				reloadTime = 80;
				cost = 20;
				toString = "Pump_Action";
				break;
			case P90:
				damage = 10;
				clip = 10;
				img = new ImageIcon("Images/P90.png");
				reloadTime = 60;
				cost = 50;
				toString = "P90";
				break;
			case Rifle:
				damage = 20;
				clip = 3;
				img = new ImageIcon("Images/Rifle.png");
				reloadTime = 20;
				cost = 100;
				toString = "Rifle";
				break;
			case M16:
				damage = 15;
				clip = 30;
				img = new ImageIcon("Images/M16.png");
				reloadTime = 50;
				cost = 200;
				toString = "M16";
				break;
		}
	}
	//returns clip size for gun
	public int getClip()
	{
		return clip;
	}
}
